x86: prevent call to xfree() in dump_irqs() while in an irq context
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 22 May 2012 14:28:45 +0000 (16:28 +0200)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 22 May 2012 14:28:45 +0000 (16:28 +0200)
commit8c09a7869b615141a60e798f6699b93084a57fd4
tree4f06c80ea67e419447a0a1f37eebef3481b9d45a
parent759e255deba72f94365d35643fb4ae72ce59f237
x86: prevent call to xfree() in dump_irqs() while in an irq context

Because of c/s 24707:96987c324a4f, dump_irqs() can now be called in an
irq context when a bug condition is encountered. If this is the case,
ignore the call to xsm_show_irq_ssid() and the subsequent call to
xfree().

This prevents an assertion failure in xfree(), and should allow all the
debug information to be dumped, before failing with a BUG() because of
the underlying race condition we are attempting to reproduce.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Rather than using the non-obvious conditional around an xfree() that
would be passed NULL only in the inverse case (which could easily get
removed by a future change on the basis that calling xfree(NULL) is
benign), switch the order of checks in xfree() itself and only suppress
the call to XSM that could potentially call xmalloc().

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Committed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/irq.c
xen/common/xmalloc_tlsf.c